//
//  action_ctrl.h
//  smart_garbage_case
//
//  Created by fukai on 2018/11.
//  Copyright © 2018年 Cyber01. All rights reserved.
//

#ifndef action_ctrl_h
#define action_ctrl_h



//舵机控制部分
typedef enum
{
	COVER_CLOSE = 0,	//盖子打开
	COVER_OPEN,	//盖子关闭
}ServoAcFlagNode;

typedef struct
{
	int pwm_close;
	int pwm_open;
	
	ServoAcFlagNode ServoAcFlag;
}ServoCtrlNode;


//电机控制部分
typedef enum
{
	CAR_STOP = 0,
	CAR_START,
}MotorACFlagNode;

typedef struct
{
	int front_left_pwm;
	int front_right_pwm;
	int rear_left_pwm;
	int rear_right_pwm;
	
	MotorACFlagNode MotorACFlag;
}MotorCtrlNode;


#include "../api/mecanum_wheel.h"

//动作控制结构体
typedef struct
{
	ServoCtrlNode ServoCtrl;
	MotorCtrlNode MotorCtrl;
	MecanumWheelParmNode MecanumWheelParm;
}ActionCtrlNode;



void ServoStatusCtrl(void);//舵机状态控制
void ServoStatusChange(void);//舵机状态转变
void MotorStatusChange(void);//电机状态转变
void MotorCtrl(void);//电机控制
void GetExpectSpeedVectorTimer(int times);
extern ActionCtrlNode ActionCtrl;
extern WheelEVNode WheelEV;
extern int y_times , x_times , z_times;
extern int turn_speed;
#endif


